package house.entity;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import java.util.Date;

@Entity
public class COrder extends BasicEntity{

    @ManyToOne
    private House house;
    @ManyToOne
    private User owner;
    @ManyToOne
    private User tenant;
    private String rentType; // 租房 退租
    private String status;

    private String orderNo;
    private Date startTime;
    private Date finishTime;


    public COrder() {}
    public COrder(House house, User owner, User tenant, String type) {
        this.house = house;
        this.owner = owner;
        this.tenant = tenant;
        this.rentType = type;
        this.status = "等待房东回复";
    }

    public House getHouse() {
        return house;
    }

    public void setHouse(House house) {
        this.house = house;
    }

    public User getOwner() {
        return owner;
    }

    public void setOwner(User owner) {
        this.owner = owner;
    }

    public User getTenant() {
        return tenant;
    }

    public void setTenant(User tenant) {
        this.tenant = tenant;
    }

    public String getRentType() {
        return rentType;
    }

    public void setRentType(String type) {
        this.rentType = type;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }
}
